package com.beiding.service.user;

import com.beiding.pojo.auth.User;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.security.Principal;

public interface UserService extends UserDetailsService {

    void changePassword(String name, String newPassword);

    void changeEmail(String name, String newEmail);

    void save(User user);

    boolean checkPassword(String name, String oldPassword);

    void addAuthority(String name, GrantedAuthority authority);

    String getEmail(String name);

    void unsubscribe(Principal principal);

    User getUser(String username);
}
